import type { HasId, IList, IResult } from "@/types/common";
import { getAxios, commonAxiosJson } from "@/utils/request.js";
/* 获取 红包商城 订单信息 地址*/
const url = "/back/mall-order";
/*获取 红包商城 订单信息 */
export const getMallOrderInfo = <T, D>(params?: D): Promise<IResult<IList<T>>> => {
  return getAxios<IList<T>, D>(url, params);
};
/* 红包商城数据：通过id获取 订单信息 */
export const getMallOrderByIdInfo = <T, D extends HasId>(params: D): Promise<IResult<T>> => {
  return getAxios<T, D>(url + "/" + params.id, params);
};
/*获取 红包商城 打印快递单信息 */
export const getMallOrderPrintExpressInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return getAxios<T, D>(url + "/print-express", params);
};
/*获取 红包商城 再次打印快递单信息 */
export const getMallOrderPrintOldExpressInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return getAxios<T, D>(url + "/print-old-express", params);
};
/*获取 红包商城 导出excel信息 */
export const getMallOrderExportExcelInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return getAxios<T, D>(url + "/export", params);
};
/* 红包商城数据：订单 发货 信息 */
export const putBannerOrderDeliveryInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url + "/order-delivery", params, "PUT");
};
/* 红包商城数据：订单 商家备注 信息 */
export const putMallOrderRemarkInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url + "/order-remark", params, "PUT");
};
/* 红包商城数据：订单 订单优惠 信息 */
export const putMallOrderReduceInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url + "/order-reduce", params, "PUT");
};
/* 红包商城数据：订单 订单取消 信息 */
export const putMallOrderCancelInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url + "/cancel-order", params, "PUT");
};
/* 红包商城数据：订单 确认收货 信息 */
export const putMallOrderConfirmInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url + "/confirm-order", params, "PUT");
};
/* 红包商城数据：订单 确认退款 信息 */
export const putMallOrderAgreeRefundInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url + "/agree-refund-order", params, "PUT");
};
/* 红包商城数据：订单 确认驳回退款 信息 */
export const putMallOrderRejectRefundInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url + "/reject-refund-order", params, "PUT");
};
/* 红包商城数据：订单 订单打印 信息 */
export const getMallOrderPrintInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return getAxios<T, D>(url + "/order-print", params);
};
/* 红包商城数据：订单 修改订单打印状态 信息 */
export const putMallHasPrintInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url + "/has-print", params, "PUT");
};
/* 红包商城数据：订单 修改订单退款状态（客服发起退款） 信息 */
export const putMallApplyRefundOrderInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url + "/apply-refund-order", params, "PUT");
};
